/* demo2.c - demo program using cputil
 */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "cputil.h"

#define MAXN 128

int main(int argc, char *argv[]) {
  long n;
  unsigned long curr, divr;
  double resd;
  //float resf;

  CU_REGTHR();

  n = strtol(argv[1], 0, 10);
  CU_CLRCTR();
  resd = (double)n*3.14159e-32 + sqrt((double)n)*3.14159e-3;
  //resf = (float)n*3.14159e-32 + sqrt((double)n)*3.14159e-3;
  curr = CU_GETCTR();
  divr = CU_GETDIV();
  printf("resd=%f\n", resd);
  //printf("resf=%f\n", resf);
  printf("delta: %lu/%lu\n", curr, divr);
  
  return 0;
}
/* --- last line --- */
